home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume2 / cshar3 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  5.8 KB

  1. From: harvard!seismo!mcvax!datlog!mark
  2. Subject: Update to C shar (shell archiver)
  3. Newsgroups: mod.sources
  4. Approved: john@genrad.UUCP
  5.  
  6. Mod.sources:  Volume 2, Issue 13
  7. Submitted by: harvard!seismo!mcvax!datlog!mark (Mark Smith)
  8.  
  9. [ moderators note:  I have edited both the introduction, and deleted most
  10.   of the files from the submitted shell archive - nearly all the files were
  11.   the same as the original distribution.  All that had changed was the
  12.   Makefile and the man page.  Contact me if you need a copy of the original
  13.   C shar distribution.
  14.   
  15.   John P. Nelson (decvax!genrad!john) [moderator, mod.sources]
  16. ]
  17.  
  18.     My firm runs UNIX System V release 2 version 1 on a VAX 11/750. 
  19.     The shar that was acquired when we joined the net is ok but makes 
  20.     a real mess when source files have to be taken from more than one
  21.     directory and no manual page was provided.
  22.  
  23.         I decided to use the version of shar that I found on
  24.     mod.sources but unfortunately using the getopt.c supplied with
  25.     the package caused an undefined symbol at load time which
  26.     prevented shar being built.  As SVr2 comes with getopt.o as
  27.     part of /lib/libc.a and the parameter list is compatible I built
  28.     my shar with the SVr2 getopt.o and it seems to work fine.
  29.  
  30.         Below is a shell archive of the files I used to build the 
  31.     new version of shar. [Actually, only the files that have been
  32.     modified from the original are in the archive below - mod.]  The
  33.     Makefile is greatly improved and will now install the binaries and
  34.     the manual pages and clean up the mess afterwards.  I have also
  35.     modified the manual pages because as they stood man(1) on my
  36.     system was producing sentences with words missed out.
  37.  
  38.  
  39.             All the best,
  40.                 Mark Smith
  41.  
  42.  
  43. UUCP: ...!mcvax!ukc!stc!datlog!mark
  44.  
  45. --------------------------- cut here -----------------------------
  46. #! /bin/sh
  47. # This is a shell archive, meaning:
  48. # 1. Remove everything above the #! /bin/sh line.
  49. # 2. Save the resulting text in a file.
  50. # 3. Execute the file with /bin/sh (not csh) to create the files:
  51. #    Makefile
  52. #    shar.1
  53. # This archive created: Mon Jul 15 09:55:53 1985
  54. export PATH; PATH=/bin:$PATH
  55. if test -f 'Makefile'
  56. then
  57.     echo shar: will not over-write existing file "'Makefile'"
  58. else
  59. sed 's/^X//' << \SHAR_EOF > 'Makefile'
  60. X
  61. X# make this getopt.o if on a BSD or other non system V
  62. XGETOPT=
  63. X
  64. XCFLAGS=-O
  65. X
  66. Xall:    traverse shar
  67. X
  68. Xshar:    shar.o traverse.o $(GETOPT)
  69. X    $(CC) -o shar shar.o traverse.o $(GETOPT)
  70. X
  71. Xtraverse:
  72. X    $(CC) $(CFLAGS) -o traverse -DSTANDALONE traverse.c
  73. X
  74. Xinstall:    all
  75. X    /etc/install -f /usr/bin shar
  76. X    /etc/install -f /usr/bin traverse
  77. X    strip /usr/bin/shar /usr/bin/traverse
  78. X    cp shar.1 /usr/man/u_man/man1/shar.1
  79. X    cp traverse.3 /usr/man/p_man/man3/traverse.3
  80. X
  81. Xclean:
  82. X    rm -f shar traverse *.o
  83. X
  84. Xshar.shar: Makefile shar.c traverse.c shar.1 traverse.3
  85. X    shar -a -d EOF_SHAR Makefile shar.c traverse.c shar.1 traverse.3 > shar.shar
  86. SHAR_EOF
  87. fi # end of overwriting check
  88. if test -f 'shar.1'
  89. then
  90.     echo shar: will not over-write existing file "'shar.1'"
  91. else
  92. sed 's/^X//' << \SHAR_EOF > 'shar.1'
  93. X
  94. X.TH SHAR 1net "June 3, 1985" "UNIX User's Manual" "Wang Institute"
  95. X.SH NAME
  96. Xshar \- create file storage archive for extraction by /bin/sh
  97. X.SH SYNOPSIS
  98. X.B shar
  99. X[-abcsv] [-d delim] [-p prefix] files
  100. X.SH DESCRIPTION
  101. X.I shar
  102. Xprints its input files with special command lines around them
  103. Xto be used by the shell,
  104. X.I /bin/sh ,
  105. Xto extract them later.
  106. XThe output can be filtered through the shell to
  107. Xrecreate copies of the original files.
  108. X.PP
  109. X.I shar
  110. Xallows directories to be named, and
  111. X.I shar
  112. Xprints the necessary commands
  113. X.ul
  114. X(mkdir & cd)
  115. Xto create new directories and fill them.
  116. X.I shar
  117. Xwill emit commands to make executable plain files executable.
  118. X.I shar will not allow existing files to be
  119. X.I over-written;
  120. Xsuch files must be removed by the file extractor.
  121. X.SH OPTIONS
  122. X.de OP
  123. X.TP
  124. X.B -\\$1
  125. X..
  126. X.OP a
  127. XAll the options.
  128. XThe options:
  129. X.B "-v -c -b -p <tab>X"
  130. Xare implied.
  131. X.OP s
  132. XSilent running.
  133. XAll checking and extra output is inhibited.
  134. X.OP v
  135. XPrint verbose feedback messages about what
  136. X.I shar
  137. Xis doing to be printed during extraction.
  138. XSizes of plain files are echoed to allow a simple validity check.
  139. X.OP c
  140. XCheck file size on extraction by counting characters.
  141. XAn error message is reported to the person doing the
  142. Xextraction if the sizes don't match.
  143. XOne reason why the sizes may not match is that
  144. X.I shar
  145. Xwill append a newline to complete incomplete last lines;
  146. X.I shar
  147. Xprints a message that mentions added newlines.
  148. XAnother reason why the sizes may not match is that some
  149. Xnetwork mail programs remove non-whitespace control characters.
  150. X.I shar
  151. Xprints a message that mentions control characters to the extractor.
  152. X.OP b
  153. XExtract files into basenames so that files with absolute path names
  154. Xare put into the current directory.
  155. XThis option has strange effects when directories are archived.
  156. X.OP d delim
  157. XUse this as the ``end of file'' delimiter instead of the default.
  158. XThe only reason to change it is if you suspect a file
  159. Xcontains the default delimiter:
  160. X.B SHAR_EOF.
  161. X.OP p prefix
  162. XUse this as the prefix to each line of the archived files.
  163. XThis is to make sure that special characters at the start of lines are not
  164. Xeaten up by programs like mailers.
  165. XIf this option is used,
  166. Xthe files will be extracted with the stream editor
  167. X.B sed
  168. Xrather than
  169. X.B cat
  170. Xso it is more efficient and portable to avoid setting the prefix,
  171. Xthough perhaps less safe if you don't know what is in the files.
  172. X.SH "SEE ALSO
  173. Xtar(1), cpio(1), tp(1), sh(1)
  174. X.SH AUTHOR
  175. XGary Perlman
  176. X(based on a shell version by James Gosling,
  177. Xwith additions motivated by
  178. XDerek Zahn,
  179. XMichael Thompson,
  180. XH. Morrow Long,
  181. XFred Avolio,
  182. XGran Uddeborg,
  183. X&
  184. XChuck Wegrzyn)
  185. X.SH LIMITATIONS
  186. X.I shar
  187. Xdoes not know anything about
  188. Xlinks between files
  189. Xor binary files.
  190. SHAR_EOF
  191. fi # end of overwriting check
  192. #    End of shell archive
  193. exit 0
  194.